define(["dojo/_base/declare", "dojox/grid/TreeGrid", "dojo/data/ItemFileReadStore", "dojo/data/ItemFileWriteStore"], function(declare){
    declare("my.grid.HistoryGrid", [dijit.form.Form], {

		dotFormatter : function(value, rowIdx){
			if(rowIdx >= 0){
				return value;
			}
			return "";
		},
		
		startup : function(){
			
			var grid = dijit.byId("historyGrid");
			var structure =  [{ cells: [[
			                             { field: "title", name: "Title", width: "17%"},
			                             { field: "date", name: "Date", width: "17%"},
			                             { field: "rachOut", name: "Outgoing account", width: "17%"},
			                             { field: "rachIn", name: "Destination", width: "17%"},
			                             { field: "rec", name: "Receiver", width: "17%"},
			                             { field: "recDet", name: "Receiver details", width: "17%"},
			                             { field: "casch", name: "Resources", width: "17%"}
			                             ]] }];
			this.inherited(arguments);
    	    grid.set("structure", structure);
    	    grid.startup();
    	    
    	    var historyStore = new dojo.data.ItemFileWriteStore(
		    	    {
		    	    	url:'getHistoryAction.action',
		 			    requestMethod : "post"
		    	    });
    	    var mockStore = new dojo.data.ItemFileWriteStore({url:'scheduleJson.json'});
    	    grid.setStore(historyStore);
		}
    	
    });
});